package com.cj.bus.common.entity;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSeeAlso;

@Data
@JsonSerialize
@JsonInclude(Include.NON_NULL)
public class ResponseEntity<T> implements Serializable{

    private static final long serialVersionUID = -3773831545028290390L;

    private Boolean status;

    //接口状态码
    private Integer code;

    //提示消息
    private String message;

    //接受业务数据
    private T result;

    public ResponseEntity(boolean status,Integer code, String message){
        this.status = status;
        this.code = code;
        this.message = message;
    }

    public ResponseEntity(Integer code, String message) {
        super();
        this.code = code;
        this.message = message;
    }

    public ResponseEntity(boolean status,Integer code, T result) {
        super();
        this.status = status;
        this.code = code;
        this.result = result;
    }

    public ResponseEntity(boolean status,Integer code) {
        super();
        this.code = code;
        this.status = status;
    }
    
    public ResponseEntity() {
    	
    }

    public ResponseEntity setCode(Integer code) {
        this.code = code;
        return this;
    }
}